//
//  MSCollectionViewCell.m
//  Cartoon
//
//  Created by yaren hunter on 2017/4/24.
//  Copyright © 2017年 yaren. All rights reserved.
//

#import "MSCollectionViewCell.h"
#import "Header.h"

@interface MSCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UILabel *label;

@end

@implementation MSCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.right.equalTo(self.mas_right);
        make.top.equalTo(self.mas_top).offset(PADDING / 2);
        make.height.equalTo(self.mas_height).multipliedBy(0.83);
    }];
    [_label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.right.equalTo(self.mas_right);
        make.top.equalTo(_imageView.mas_bottom);
//        make.height.equalTo(self.mas_right).multipliedBy(0.2);
        make.bottom.equalTo(self.mas_bottom).
        offset(-PADDING / 2);
    }];
    // Initialization code
}

//- (instancetype)initWithFrame:(CGRect)frame{
//    self = [super initWithFrame:frame];
//    if (self) {
//        self = [[NSBundle mainBundle]loadNibNamed:@"collectionViewCell" owner:self options:nil].lastObject;
//    
//    }
//    return self;
//}

- (void)updateCellWithModel:(MSCoverModel *)dateModel{
    _imageView.image = dateModel.image;
    _label.text = dateModel.title;
}
@end
